﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Service
{
    /// <summary>
    /// 运行为服务的类
    /// </summary>
    public interface IServiceModule
    {
        /// <summary>
        /// 服务选项
        /// </summary>
        ServiceXml serviceOptions { get;}
        void ConfigApp(HostBuilderContext appContext, IConfigurationBuilder configuration);
        void ConfigService(IServiceCollection services);
    }

    public class ServiceXml
    {
        /// <summary>
        /// 服务唯一Id
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 服务名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 服务描述
        /// </summary>
        public string description { get; set; }
        /// <summary>
        /// 参数
        ///eg： -Xrs -Xmx256m -jar
        /// </summary>
        public string arguments { get; set; }
        /// <summary>
        /// 执行的程序 
        /// eg:myapp.exe
        /// </summary>
        public string executable { get; set; }
    }
}
